<template>
	<view class="">
		<slide-popup :minHeight="230" :showLine="true" @swipeClick="swipeClick">
			<view class="tapBoxTouchLine" slot="header">
				<view class="line"></view>
				<view class="title">{{ markShow ? '返回趣味抽盒' : '获取更多游戏机会' }}</view>
				<view class="text-tw">任务中心</view>
			</view>
			<view class="mission-center">
				<!-- <image src="../../static/carton-drawer/banner.png" mode=""></image> -->
				<view class="">
					<view class="mission-board-li" v-for="item in missionList">
						<view class="h3">{{ item.texth }}</view>
						<view class="task-list" v-for="i in item.taskList">
							<!-- <image :src="i.url" mode=""></image> -->
							<view class="task-warp">
								<view class="title">{{ i.title }}</view>
								<view class="ip-beans">
									可获得
									<text>{{ i.ipbeans }}</text>
									豆
								</view>
								<view class="text">{{ i.text }}</view>
							</view>
							<button class="give-away-btn" @click="leftClick">去完成</button>
						</view>
					</view>
				</view>
			</view>
		</slide-popup>
		<!-- 遮盖层 -->
		<view class="mark" v-show="markShow"></view>
	</view>
</template>

<script>
	import slidePopup from '@/components/slide-popup/slide-popup.vue';
	export default {
		comments:{
			slidePopup
		},
		data() {
			return {
				markShow: false,
				missionList: [{
						texth: '新手任务',
						taskList: [{
								url: '../../static/carton-drawer/fx-icon.png',
								text: '每日限制一次',
								ipbeans: '300Ip',
								title: '分享好友'
							},
							{
								url: '../../static/carton-drawer/yq-icon.png',
								text: '邀请开卡有礼',
								ipbeans: '100Ip',
								title: '不限次数'
							}
						]
					},
					{
						texth: '进阶任务',
						taskList: [{
							url: '../../static/carton-drawer/gw-icon.png',
							text: '不限次数',
							ipbeans: '100 Ip',
							title: '购买商品'
						}]
					},
					{
						texth: '进阶任务',
						taskList: [{
							url: '../../static/carton-drawer/gw-icon.png',
							text: '不限次数',
							ipbeans: '100 Ip',
							title: '购买商品'
						}]
					},
					{
						texth: '进阶任务',
						taskList: [{
							url: '../../static/carton-drawer/gw-icon.png',
							text: '不限次数',
							ipbeans: '100 Ip',
							title: '购买商品'
						}]
					},
					{
						texth: '进阶任务',
						taskList: [{
							url: '../../static/carton-drawer/gw-icon.png',
							text: '不限次数',
							ipbeans: '100 Ip',
							title: '购买商品'
						}]
					}
				]
			};
		},
		watch: {
			markShow(n) {
				this.markShow = n
			}
		},
		methods: {
			swipeClick(show) {
				this.markShow = show;
			},
			toAchieve() {}
		}
	};
</script>

<style lang="scss" scoped>
	.tapBoxTouchLine {
		display: flex;
		align-items: center;
		flex-direction: column;
		justify-content: center;

		.line {
			margin: 10rpx 0;
			vertical-align: middle;
			border-bottom: 16rpx solid #9f9f9f;
			border-radius: 10rpx 10rpx 0 0;
			width: 76rpx;
			transform: scaleY(0.5);
		}

		.title {
			color: #666666;
			margin: 0;
			font-size: 24rpx;
		}

		.text-tw {
			width: 96vw;
			margin-left: 2vw;
			height: 60rpx;
			line-height: 60rpx;
			font-size: 28rpx;
			color: #999999;
			text-align: start;
		}
	}

	.mission-center {
		margin-top: 12rpx;

		image {
			width: 98%;
			margin-left: 1%;
			height: 212rpx;
			border-radius: 40rpx;
		}

		.mission-board-li {
			.h3 {
				border-left: solid #f75348 8rpx;
				padding-left: 30rpx;
				border-radius: 8rpx;
				font-size: 36rpx;
				font-weight: 700;
				margin: 40rpx 0;
			}

			.task-list {
				display: flex;
				justify-content: space-between;
				align-items: center;
				height: 160rpx;

				image {
					width: 76rpx;
					height: 76rpx;
				}

				.task-warp {
					width: 57%;

					.title {
						font-size: 32rpx;
						font-weight: 700;
						margin-bottom: 12rpx;
					}

					.ip-beans {
						font-size: 30rpx;

						text {
							color: #f1c40f;
						}
					}

					.text {
						margin-top: 4rpx;
						font-size: 24rpx;
						color: #bdbdbd;
					}
				}

				.give-away-btn {
					width: 176rpx;
					height: 60rpx;
					background: #f75348;
					border-radius: 30rpx;
					color: #ffffff;
					padding: 0 !important;
					margin: 0 !important;
					font-size: 28rpx;
					line-height: 60rpx;
				}
			}
		}
	}


	.mark {
		position: fixed;
		height: 100vh;
		background: rgba(0, 0, 0, 0.1);
		left: 0%;
		right: 0%;
		top: 0;
		z-index: 100;
	}
</style>
